package org.bees.cms.service.bean.furnish;

import java.util.List;

import javax.persistence.EntityManager;

import org.bees.cms.core.furnish.Kind;
import org.bees.cms.service.bean.NamedServiceSupport;
import org.bees.cms.service.bean.ServiceSupport;
import org.bees.cms.service.furnish.KindService;
import org.springframework.stereotype.Service;

@Service
public class KindServiceBean extends ServiceSupport<Kind> implements KindService {
	protected NamedServiceBean namedServiceBean = new NamedServiceBean();

	@Override
	public Kind findByName(String name) throws Exception {
		return namedServiceBean.findByName(name);
	}

	@Override
	public List<Kind> listByName(String name) throws Exception {
		return namedServiceBean.listByName(name);
	}

	protected class NamedServiceBean extends NamedServiceSupport<Kind> {

		@Override
		protected EntityManager manager() {
			return manager;
		}

		@Override
		protected Class<Kind> parameter() {
			return parameter;
		}

	}
}
